home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pru_piranhadeath.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  119 lines

  1. #
  2. # Jones 3D Cog Script
  3. #
  4. # PRU_piranhaDeath.cog    Swim in the rapids, piranhas will eat you.
  5. #
  6. # [GGJ]    This cog is dedicated to the memory of "Bub," my first pet piranha.
  7. # Most work done by CogMaster [PKM]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ========================================================================================
  12. symbols
  13.  
  14. message    startup
  15. message    entered
  16. message timer
  17.  
  18. sector    trigger
  19.  
  20. template    tplActor=indy_sh_actor    local
  21. #template    tplHatRaft=rafthat        local
  22.  
  23. thing        fishCam
  24. thing        fadePlate
  25. thing        deathTarget
  26.  
  27. thing        piranha0        nolink
  28. thing        piranha1        nolink
  29. thing        piranha2        nolink
  30. thing        piranha3        nolink
  31. thing        piranha4        nolink
  32. thing        piranha5        nolink
  33. thing        piranha6        nolink
  34. thing        piranha7        nolink
  35. thing        piranha8        nolink
  36. thing        piranha9        nolink
  37.  
  38. thing        actor            local
  39. thing        player            local
  40.  
  41. keyframe    jumpKey=pi_jump.key    local
  42. int            currentFish            local
  43.  
  44. end
  45.  
  46. # ========================================================================================
  47. code
  48. startup:
  49.  
  50.     player = GetLocalPlayerThing();
  51.  
  52.     SetThingFlags(fadePlate, 0x80000);
  53.  
  54.     for (currentFish = 0; currentFish <= 9; currentFish = currentFish + 1)
  55.     {
  56.         AISetCutsceneMode(piranha0[currentFish]);
  57.         SetThingFlags(piranha0[currentFish], 0x80000);
  58.     }
  59.  
  60.     currentFish = 0;
  61.  
  62.     return;
  63.  
  64. entered:
  65.  
  66.     StartCutscene(1);
  67.         
  68.     # Stop the player from moving
  69.     SetActorFlags(player, 0x200000);
  70.  
  71.  
  72. //    hatRaft = CreateThing(tplHatRaft, player);
  73.  
  74. //    SetThingFlags(player, 0x80000);
  75. //    ClearThingFlags(actor, 0x80000);
  76.  
  77.     # Cut to fishCam
  78.     if (!BITTEST(GetThingFlags(player), 0x202))
  79.     {
  80.         SetCameraFocus (2, fishCam);
  81.         SetCameraSecondaryFocus(2, player);
  82.         SetCurrentCamera(2);
  83.         Sleep(0.01);
  84.         SetCameraLookInterp(2, 1);
  85.     }
  86.     MoveThingToPos(player, GetThingPos(deathTarget), 2.0);
  87.  
  88.     SetTimer(1.0);
  89.  
  90.     return;
  91.  
  92. timer:
  93.     if (currentFish == 7)
  94.     {
  95.         ClearThingFlags(fadePlate, 0x80000);
  96.         ThingFadeAnim(fadePlate, 0, 1, 1.0, 0);
  97.     }
  98.  
  99.     ClearThingFlags(piranha0[currentFish], 0x80000);
  100.     PlayKey(piranha0[currentFish], jumpKey, 7, 0x00, 0);
  101.  
  102.     if (currentFish == 9)
  103.     {
  104.         Sleep(2.0);
  105.  
  106.         EndCutscene();    
  107.         DamageThing(player, GetHealth(player) + 1, 1, 0);
  108.  
  109.         return;
  110.     }
  111.  
  112.     currentFish = currentFish + 1;
  113.  
  114.     SetTimer(0.05 + (Rand() * 0.1));
  115.  
  116.     return;
  117.  
  118. end
  119.